﻿<%@ WebHandler Language="C#" Class="activepwd" %>

using System;
using System.Web;

public class activepwd : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        BLL.Users blluser = new BLL.Users();
        string name = context.Request["name"].ToString();
        string pwd = context.Request["pwd"].ToString();
        if (!string.IsNullOrWhiteSpace(name) && !string.IsNullOrWhiteSpace(pwd))
        {
            try
            {
                if (blluser.resetPwdByName(name,common.GetMD5(pwd)))
                {
                    context.Response.Write("重置密码成功");
                }
                else
                {
                    context.Response.Write("重置密码失败，请重新重置一次");
                }
                
            }
            catch (Exception ex)
            {
                context.Response.Write("重置密码出现异常，未能成功");
                throw new Exception(ex.Message);
            }
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}